<#assign ctx=request.contextPath />
<#macro bar view="" add="" edit="" delete="" >
<script type="text/html" id="itemBar">
<#if view!="">
<@shiro.hasAnyPermissions name="${view}">
  	<a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
</@shiro.hasAnyPermissions>	
<#else>
	<a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
</#if>

<#if edit!="">
<@shiro.hasAnyPermissions name="${edit}">
  	<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
</@shiro.hasAnyPermissions>
<#else>
	<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
</#if>
<#if delete!="">
<@shiro.hasAnyPermissions name="${delete}">
  	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</@shiro.hasAnyPermissions>
<#else>
  	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</#if>
</script>
<script type="text/html" id="topBar">
<#if add!="">
<@shiro.hasAnyPermissions name="${add}">
	<div class="layui-inline" lay-event="add"><i class="layui-icon layui-icon-add-1"></i></div>
</@shiro.hasAnyPermissions>
<#else>
	<div class="layui-inline" lay-event="add"><i class="layui-icon layui-icon-add-1"></i></div>
</#if>
<#if delete!="">
<@shiro.hasAnyPermissions name="${delete}">
	<div class="layui-inline" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></div>
</@shiro.hasAnyPermissions>
<#else>
	<div class="layui-inline" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></div>
</#if>
</script>
</#macro>